﻿#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include<Don_tModify/stackwindow.h>
#include<QUrl>
#include<QWebView>
#include<QStackedLayout>
#include<Don_tModify/mousefilter.h>
#include <QMainWindow>
#include <QGraphicsOpacityEffect>
#include"leftdockwindow.h"
#include"rightdockwindow.h"
#include<QLabel>
#include <QResizeEvent>
#include"Don_tModify/closebutton.h"
#include"toprightdockwindow.h"
#include"topleftdockwindow.h"
#include <QPropertyAnimation>
#include<QTimer>
#include<picturelayer.h>
#include<QGraphicsView>
#include <QGraphicsProxyWidget>
#include <QGraphicsPixmapItem>
#include<bottomdockwindow.h>
#include<QSequentialAnimationGroup>
#include<QThread>
void setButtonStyle(QPushButton *pushButton, const QString &imageUrl1, const QString &imageUrl2);
class MyMainWindow : public QMainWindow
{
    Q_OBJECT
public:
    QMap<QString,StackWindow*>stackMap;
    PictureLayer *layer;
    QWebView *webView;
    float leftMaskWidth=150,rightMaskWidth=300,topY=60,bottomY=150,transparency=0.3;
     float leftDockWindowInitY=100,rightDockWindowInitY=100,rightDockWindowInitX=this->width()-25;

    //Stack Windows:
    LeftDockWindow *leftDockWindow;
    RightDockWindow *rightDockWindow;
    TopRightDockWindow *topRightDockWindow;
    TopLeftDockWindow *topLeftDockWindow;
    BottomDockWindow *bottomDockWindow;
    explicit MyMainWindow(QWidget *parent = 0);
    ~MyMainWindow();

    //method
    void init();

    QPointF delta;
    QPointF mousePos=QPointF(0,0);
signals:
    void hasResized();
    void startPainting();
protected:
    virtual void resizeEvent(QResizeEvent *event) override;

public :
    //Power Key
    void creatQuitMessageBox();
    void setPowerKeyStyle(QPushButton *pushButton);

};

#endif // MAINWINDOW_H
